﻿#region Header
// Copyright 2007-2011, Jerónimo Milea
// 
// This file is part of NetJsWire.
// 
//     NetJsWire is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General Public License as published by
//     the Free Software Foundation, either version 3 of the License, or
//     (at your option) any later version.
// 
//     NetJsWire is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General Public License for more details.
// 
//     You should have received a copy of the GNU General Public License
//     along with NetJsWire.  If not, see <http://www.gnu.org/licenses/>.
#endregion

using System.ComponentModel;

namespace NetJsWire.Widgets.Ui.List
{
    public class ListViewColumn
    {
        /// <summary>
        ///   Set the CSS text-align property of the column. Defaults to 'left'.
        /// </summary>
        [Description( "Set the CSS text-align property of the column. Defaults to 'left'." )]
        [DefaultValue( "left" )]
        public string Align { get; set; }

        /// <summary>
        ///   Optional. This option can be used to add a CSS class to the cell of each row for this column.
        /// </summary>
        [Description( "Optional. This option can be used to add a CSS class to the cell of each row for this column." )]
        [DefaultValue( ( string ) null )]
        public string Cls { get; set; }

        /// <summary>
        ///   Required. The name of the field in the ListViews's Ext.data.Store's Ext.data.Record definition from which to draw the column's value.
        /// </summary>
        [Description( "Required. The name of the field in the ListViews's Ext.data.Store's Ext.data.Record definition from which to draw the column's value." )]
        [DefaultValue( ( string ) null )]
        public string DataIndex { get; set; }

        /// <summary>
        ///   Optional. The header text to be used as innerHTML (html tags are accepted) to display in the ListView.
        /// </summary>
        /// <remarks>
        ///   Note: to have a clickable header with no text displayed use ' '.
        /// </remarks>
        [Description( "Optional. The header text to be used as innerHTML (html tags are accepted) to display in the ListView.\nNote: to have a clickable header with no text displayed use ' '." )]
        [DefaultValue( ( string ) null )]
        public string Header { get; set; }

        /// <summary>
        ///   Optional. Specify a string to pass as the configuration string for Ext.XTemplate. By default an Ext.XTemplate will be implicitly created using the dataIndex.
        /// </summary>
        [Description( "Optional. Specify a string to pass as the configuration string for Ext.XTemplate. By default an Ext.XTemplate will be implicitly created using the dataIndex." )]
        [DefaultValue( ( string ) null )]
        public string Tpl { get; set; }

        /// <summary>
        ///   Optional. Percentage of the container width this column should be allocated. Columns that have no width specified will be allocated with an equal percentage to fill 100% of the container width. To easily take advantage of the full container width, leave the width of at least one column undefined.
        /// </summary>
        /// <remarks>
        ///   Note that if you do not want to take up the full width of the container, the width of every column needs to be explicitly defined.
        /// </remarks>
        [Description( "Optional. Percentage of the container width this column should be allocated. Columns that have no width specified will be allocated with an equal percentage to fill 100% of the container width. To easily take advantage of the full container width, leave the width of at least one column undefined.\nNote that if you do not want to take up the full width of the container, the width of every column needs to be explicitly defined." )]
        [DefaultValue( 0D )]
        public double Width { get; set; }
    }
}
